<template>
  <div class="appts-reg" data-info="预约-挂号-取号">
    <el-row :gutter="28">
      <template v-for="item in apptsRegOptions">
        <el-col class="biz-item" :span="item.span">
          <div
              class="biz-item-inside"
              :class="item.className"
              @click="handleToBizs(item)"
          >
            <div class="info-wrap">
              <p class="icon"></p>
              <p class="name">{{ item.name }}</p>
            </div>
          </div>
        </el-col>
      </template>
    </el-row>
    <!--底部操作-->
    <PatientNumberOperate :time="backcountdown" @handleBack="handleHome"/>
  </div>
</template>

<script>
import PatientNumberOperate from '../comps/patientNumberOperate'
export default {
  name: 'apptsReg',

  componentName: "apptsReg",

  components: {
    PatientNumberOperate,
  },

  data() {
    return {
      steps: 1,
      backcountdown: 120000,
      apptsRegOptions: [
        {
          id: 1,
          span: 12,
          className: 'reservation-info',
          name: '自助预约',
          routeName:'reservation',
          enName:'self-service reservation',
          descInfo:'自助预约业务'
        },
        {
          id: 2,
          span: 12,
          className: 'register-register',
          name: '自助挂号',
          routeName:'register',
          enName:'self-service register',
          descInfo:'自助挂号业务'
        },
        {
          id: 3,
          span: 24,
          className: 'takeNumber-info',
          name: '自助取号',
          routeName:'takeNumber',
          enName:'self-service takeNumber',
          descInfo:'自助取号业务'
        },
      ]
    }
  },

  computed: {},

  mounted(){
    console.log('mounted')
    this.$store.dispatch('DRCbiz/setCTDTimeInfo',90000);
  },

  methods: {
    /*预约-挂号-取号*/
    handleToBizs(row = Object()){
      this.$store.dispatch('DRCbiz/setBizInfo',row);
      let routeName = row?.routeName;
      this.$router.push({
        path: `/${routeName}/${row.id}`
      });
    },

    handleHome(){
      clearInterval(this.timer);
      this.$router.push({
        path: `/DRCbizList`
      });
    }
  },
}

</script>

<style scoped lang="scss">
@import "./assets/style";
</style>